package com.itheima.goods.utils;

import com.github.pagehelper.PageInfo;
import com.itheima.entity.PageResult;

import java.util.List;

/**
 * @author TSV
 * @description 分页查询转换类
 * @date 2021/8/16
 */
public class PageInfo2PageResultUtil<T> {

    public PageResult pageInfo2PageResult(PageInfo<T> pageInfo) {
        long total = pageInfo.getTotal();
        List<T> list = pageInfo.getList();
        PageResult pageResult = new PageResult(total,list);
        return pageResult;
    }
}
